package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLLoading;

public class HLClassLoading extends HLLibClass {
    public HLClassLoading(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLLoading();
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            HLLoading.SetProgress(args.GetInt(0));
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                HLLoading.GetProgress();
            } else {
                resultOwnerObject.SetInt(resultIndex, HLLoading.GetProgress());
            }
            break;
        }
        case 2: {
            HLLoading.AddProgress(args.GetInt(0));
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                HLLoading.IsLoading();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, HLLoading.IsLoading());
            }
            break;
        }
        case 4: {
            HLLoading.Start();
            break;
        }
        }
    }
}
